#include "logger.hpp"
#include "output_builder.hpp"

using namespace std::chrono_literals;

my_log::log_format_setting& first_init()
{
	auto& setting = my_log::log_format_setting::getInstance();
	return setting;
}

int main()
{
	// auto& setting = first_init();
	my_log::async_logger logger("test", my_log::log_level::value::DEBUG, my_log::flush_strategy::balanced);
	my_log::output_arr_builder builder;
	// builder.addBuilder<my_log::file_output>("./diary1.txt");
	// logger.addFmtStrAndOutput("default", builder.build());
	// builder.changeName(0, "./diary2.txt");
	// logger.addFmtStrAndOutput("highlight", builder.build());
	logger.disableSyncWithStdio();
	builder.addBuilder<my_log::screen_output>();
	logger.addFmtStrAndOutput("default", builder.build());
	// logger.addFmtStrAndOutput("highlight", builder.build());
	// logger.setStartupDuration(1h);
	logger.start();
	for (size_t i = 0; i < 2; ++i)
	{
		logger.info(LOC, std::format("hello world {0:d}", i));
		logger.warn(LOC, std::format("hello world {0:d}", i));
	}
	return 0;
}